import request from "@/api/request";
// serverList 获取服务器列表
export function serverList() {
    return request({
        url: '/server/list/',
        method: 'get'
    })
}
// 服务器修改
export function editServer(data) {
    return request({
        url: '/server/edit/',
        method: 'post',
        data:data
    })
}
// 服务器删除
export function delServer(server_id) {
    return request({
        url: '/server/del/',
        method: 'get',
        params:{
            server_id
        }
    })
}

// 服务器新增
export function addServer(server_name, server_mac, server_ip) {
    return request({
        url: '/server/add/',
        method: 'get',
        params:{
            server_name,
            server_mac,
            server_ip
        }
    })
}
// 服务器查询
export function searchServer(server_id) {
    return request({
        url: '/server/get',
        method: 'get',
        params:{
            server_id
        }
    })
}
// 基础数据展示
export function baseInfo(server_id) {
    return request({
        url: '/server/base/sget',
        method: 'get',
        params:{
            server_id
        }
    })
}
// CPU每个核实时占用率
export function realPerCpu(server_id) {
    return request({
        url: '/server/perf/cpuget',
        method: 'get',
        params:{
            server_id
        }
    })
}
// 服务器实时性能指标
export function realPerf(server_id) {
    return request({
        url: '/server/perf/get',
        method: 'get',
        params:{
            server_id
        }
    })
}
// 服务器GPU历史数据
export function historyGpuData(server_id, start_time, end_time, period) {
    return request({
        url: '/server/perf/gputime',
        method: 'get',
        params:{
            server_id,
            start_time,
            end_time,
            period
        }
    })
}

// 服务器CPU历史数据
export function historyCpuData(server_id, start_time, end_time, period) {
    return request({
        url: '/server/perf/cputime',
        method: 'get',
        params:{
            server_id,
            start_time,
            end_time,
            period
        }
    })
}
// 服务器磁盘历史数据
export function historyRomData(server_id, start_time, end_time, period) {
    return request({
        url: '/server/perf/romtime',
        method: 'get',
        params:{
            server_id,
            start_time,
            end_time,
            period
        }
    })
}
// 服务器内存历史数据
export function historyRamData(server_id, start_time, end_time, period) {
    return request({
        url: '/server/perf/ramtime',
        method: 'get',
        params:{
            server_id,
            start_time,
            end_time,
            period
        }
    })
}
// 服务器性能指标历史总览
export function historyAllData(server_id, start_time, end_time, period) {
    return request({
        url: '/server/perf/overview',
        method: 'get',
        params:{
            server_id,
            start_time,
            end_time,
            period
        }
    })
}
// 服务器每个cpu性能指标历史总览
export function historyPerCpuData(server_id, start_time, end_time, period) {
    return request({
        url: '/server/perf/percputime',
        method: 'get',
        params:{
            server_id,
            start_time,
            end_time,
            period
        }
    })
}
